using System;
using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;
using DG.Tweening;
using UnityEngine;
using UnityEngine.AI;

public class IconFlyToPlayer : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.F))
        {
            var player = GameObject.FindGameObjectsWithTag("Player");
            transform.DOMove(player[0].transform.position + Vector3.up, 2f);
        }
    }

    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            GameManager.Instance.moneyData.MoneyAmount += 5;
            Destroy(this.gameObject);
        }
    }
}
